<%--
  Created by IntelliJ IDEA.
  User: 27353
  Date: 2024/11/1
  Time: 17:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" >
</head>
<body>
<form action="/student/updateSave" method="post">
    <input type="hidden" name="s_id" value="${student.s_id}">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学号</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="student_num" value="${student.student_num}" class="layui-input" required>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学生的名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="student_name" value="${student.student_name}" class="layui-input" required>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">性别 0:男 1:女 2:保密</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="gender" class="layui-input" required>
                    <option value="0" ${student.gender == 0 ? 'selected' : ''}>男</option>
                    <option value="1" ${student.gender == 1 ? 'selected' : ''}>女</option>
                    <option value="2" ${student.gender == 2 ? 'selected' : ''}>保密</option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="age" value="${student.age}" class="layui-input" required>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">出生日期</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="date_of_birth" name="date_of_birth" value="${student.date_of_birth}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">班级编号</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="class_id" value="${student.class_id}" class="layui-input" required>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">宿舍编号</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="hostel_id" value="${student.hostel_id}" class="layui-input" required>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">联系电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="phone" value="${student.phone}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">电子邮件地址</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="email" value="${student.email}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">家庭住址</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="home_address" value="${student.home_address}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人姓名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="emergency_contact" value="${student.emergency_contact}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人联系电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="emergency_contact_phone" value="${student.emergency_contact_phone}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">专业</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="major" value="${student.major}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学生状态0:在读 1:毕业</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="status" class="layui-input">
                    <option value="0" ${student.status == 0 ? 'selected' : ''}>在读</option>
                    <option value="1" ${student.status == 1 ? 'selected' : ''}>毕业</option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">删除标志（0代表存在 1代表删除）</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="del_flag" class="layui-input">
                    <option value="0" ${student.del_flag == 0 ? 'selected' : ''}>存在</option>
                    <option value="1" ${student.del_flag == 1 ? 'selected' : ''}>删除</option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">更新者</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="update_by" value="${student.update_by}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="pass" value="${student.remark}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">更新</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="/static/layui/layui.js"></script>
<script>
    layui.use(['laydate', 'form'], function () {
        var laydate = layui.laydate;
        var form = layui.form;

        // 渲染日期选择器
        laydate.render({
            elem: '#date_of_birth',
            type: 'date',
            format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#create_time',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss'
        });
        laydate.render({
            elem: '#update_time',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss'
        });
    });
</script>

